<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!doctype html>
<html>
<head>
<title>首页-</title>
<base href="<%=basePath%>" />
<meta http-equiv="charset" content="iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit|ie-stand|ie-comp">
<!-- 告诉浏览器该页面适合使用什么内核进行渲染 -->
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!-- 禁止百度转码 -->
<link rel="icon" type="image/png" href="i/buyu.ico">
<!-- 给网站添加ico -->
<link rel="apple-touch-icon-precomposed" href="i/app-icon72x72@2x.png">
<!-- 对应ipad https://blog.csdn.net/freshlover/article/details/9310437 -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit|ie-stand|ie-comp">
<meta name="apple-mobile-web-app-title" content="" />
<link href="layui/css/layui.css" rel="stylesheet">
<style type="text/css">
body{
    background-color:#dedbd3;
}
</style>
</head>

<body>
	<form method="post" datasource="Essential/list" id="wholestat">   <!-- 返回所有玩家信息 -->
			<table id="my-table1" lay-filter="my-table1" class="layui-table"></table>
			<table id="my-table3" lay-filter="my-table3" class="layui-table"></table>
			<table id="my-table4" lay-filter="my-table4" class="layui-table"></table>
			<table id="my-table2" lay-filter="my-table2" class="layui-table"></table>
			<table id="my-table5" lay-filter="my-table5" class="layui-table"></table>
	</form>
</body>

    <script type="text/html" id="GlobalGameDifficultyLevel">
            {{#  if(d.GlobalGameDifficultyLevel == 0){ }}
                <span class="layui-badge">地域灾难</span>
            {{#  } else if(d.GlobalGameDifficultyLevel == 1){ }}
                <span class="layui-badge">非常困难</span>
            {{#  } else if(d.GlobalGameDifficultyLevel == 2){ }}
                <span class="layui-badge">困难</span>
            {{#  } else if(d.GlobalGameDifficultyLevel == 3){ }}
                <span class="layui-badge">中等</span>
            {{#  } else if(d.GlobalGameDifficultyLevel == 4){ }}
                <span class="layui-badge">简单</span>
            {{#  } else if(d.GlobalGameDifficultyLevel == 5){ }}
                <span class="layui-badge">分红</span>
            {{#  } else if(d.GlobalGameDifficultyLevel == 6){ }}
                <span class="layui-badge">大富豪</span>
            {{#  } }}
        </script>
    
	<script src="js/jquery.min.js"></script>
	<script src="layui/layui.js"></script>
	<script src="js/personal/formsubmit.js"></script>

    <script>
    layui.use(['layer','form','table'],function(){
    	var layer = layui.layer,
    	    form = layui.form,
    	    table = layui.table;
    	
    	
    	var data;
    	$(document).ready(function(){
    		$.ajax({
    			type:"POST",
    			url:'Essential/list',
    			async:false,
    			success:function(resp){
    				data=JSON.parse(resp);
    			}
    		});
    	});
    	table.render({
    		elem : '#my-table1',
    		id : 'Alltable1',
    		cellMinWidth : 80,
    		method:'post',
    		cols:[[
    			{field:'TotalRegisteredCount',title:'总注册',align:'center'},
    			{field:'TodayRegisteredCount',title:'今日注册',align:'center'},
    			{field:'UserOnlineCount',title:'在线',align:'center'},
    			{field:'BlockUserCount',title:'封禁用户',align:'center'}
    		]],
    		data:data
    	});
    	
    	
    	table.render({
    		elem : '#my-table2',
    		id : 'Alltable2',
    		cellMinWidth : 80,
    		method:'post',
    		cols:[[
    			{field:'BusinessmanCount',title:'会长数量',align:'center'}
    		]],
    		data:data
    	});
    	
    	table.render({
    		elem : '#my-table3',
    		id : 'Alltable3',
    		cellMinWidth : 80,
    		method:'post',
    		cols:[[
    			{field:'GlobalPrizePool',title:'全服平台水位',align:'center'},
    			{field:'GlobalGameDifficultyLevel',title:'全局游戏难度',align:'center',templet:'#GlobalGameDifficultyLevel'},
    			{field:'AllBonus',title:'全服彩金池',align:'center'},
    			{field:'TotalRecharge',title:'总充值',align:'center'},
    			{field:'TodayRecharge',title:'今日充值',align:'center'}
    		]],
    		data:data
    	});
    	
    	table.render({
    		elem : '#my-table4',
    		id : 'Alltable4',
    		cellMinWidth : 80,
    		method:'post',
    		cols:[[
    			{field:'AllCurrencyStock',title:'全服金币存量',align:'center'},
    			{field:'DiamondStock',title:'钻石',align:'center'},
    			{field:'TicketStock',title:'奖券',align:'center'},
    			{field:'IntegralStock',title:'积分',align:'center'},
    			{field:'Warhead1Stock',title:'青铜',align:'center'},
    			{field:'Warhead2Stock',title:'白银',align:'center'},
    			{field:'Warhead3Stock',title:'黄金',align:'center'},
    			{field:'Warhead4Stock',title:'紫金',align:'center'},
    		]],
    		data:data
    	});
    	
    	table.render({
    		elem : '#my-table5',
    		id : 'Alltable5',
    		cellMinWidth : 80,
    		method:'post',
    		cols:[[
    			{field:'TotalOnlineCurrency',title:'在线玩家携带 总金币',align:'center'}
    		]],
    		data:data
    	});
    	
    	//定时
    	/* setInterval(function(){
    		$.ajax({
    			type:"POST",
    			url:'Essential/list',
    			async:false,
    			success:function(resp){
    				data=JSON.parse(resp);
    				setTimeout(function(){
    		        	table.reload('Alltable1', {data:data});
    		        	table.reload('Alltable2', {data:data});
    		        	table.reload('Alltable3', {data:data});
    		        	table.reload('Alltable4', {data:data});

    				},1000);
    			}
    		});
        },60000); */
    	
    });
    </script>

</html>